const path =require('path')
const { config } = require('process')


module.exports = {
    publicPath: process.env.NODE_ENV === 'production'
        ? '/lime-website/'
        :'/',
    lintOnSave: false,
    chainWebpack: config => {
    const dir =path.resolve(__dirname,'src/assets/')
        config.module
            .rule('svg-sprite')
            .test(/\.svg$/)
            .include.add(dir).end()  //包含icons目录
            .use('svg-sprite-loader').loader('svg-sprite-loader').options({ expect: false }).end()
            .use('svg-loader').loader('svgo-loader')
            //.tap(options=>({...options,plugins:[{removeAttrs:{attrs:'fill'}}]})).end()
        config.plugin('svg-sprite').use(require('svg-sprite-loader/plugin'), [{ plainSprite: true }])
        config.module.rule('svg').exclude.add(dir)//其他svg loader 排查 icons 目录
}
}
